home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd566
/
source
/
typing speed tester.amos
/
typing speed tester.amosSourceCode
Wrap
AMOS Source Code
|
1994-01-01
|
3KB
|
100 lines
' ______________________________________________________________________
' | |
' | TYPING SPEED TESTER |
' | ~~~~~~~~~~~~~~~~~~~ |
' | Created for AMOS Basic by Glenn N Babic, 1993 |
' | |
' | Use ASCII Reader.AMOS to read "ASCII/Typing Speed Tester.doc" |
' |______________________________________________________________________|
' Activate the next command by deleting the ' if you want words to be
' counted every five characters instead of at normal space boundaries...
'M0DE=True
D_TIME#=5.0
Fix 2
' Set Up Screen...
Hide : Screen Open 0,640,242,2,Hires
Palette $FFF,$0 : Colour Back $FFF
' Main Program Loop...
Do
' Print Information Bar At Top Of Screen...
Cls
Print String$("=",80);
Print
Print
Print
Print String$("=",80)
Set Text 3
Text 168,17,"T Y P I N G S P E E D T E S T E R"
Set Text 4
Text 196,28,"Written by Glenn N Babic, 1993"
Print
' Prompt For Test Time...
Put Key Str$(D_TIME#)-" "
Input "How many minutes for test? >";D_TIME#
TIME#=D_TIME#
Exit If TIME#=0
Wait 5 : Clear Key
Print : Print "Start typing when ready..."
Print
L$="" : S$="" : Repeat : L$=Inkey$ : Until L$<>"" : Put Key L$
Timer=0
' Text Entering Loop...
Repeat
L$=Inkey$ : L=Asc(L$) : S=Scancode
If S or L
If(L>31 and L<126) or L=13 or L=9
If L<>9 : S$=S$+L$ : End If
If L=13 : S$=S$+" " : Print : End If
If L=9 : L$=" " : End If
Print L$;
Else
Bell 1
End If
End If
If L=27 Then TIME#=Timer/3000.0 : Exit
Until Timer>TIME#*3000
' Stop Test...
Print
If L<>27 Then Print : Print "STOP TYPING - TIME'S UP !!!"
Print
Bell : Wait 20 : Bell : Clear Key
' Calculate Number Of Words...
WORDS#=0 : If Right$(S$,1)<>" " Then S$=S$+" "
If M0DE
WORDS#=Len(S$)/5.0
Else
For I=1 To Len(S$)
If Mid$(S$,I,1)=" " and(Mid$(S$,I-1,1)<>" ") : WORDS#=WORDS#+1 : End If
Next I
End If
' Prompt For Number Of Words And Mistyped Words...
Put Key Str$(WORDS#)-" "
Input "Number of words typed? >";WORDS#
Input "Number of mistyped words? >";BOOBOOS#
' Print Speed and Accuracy...
Print
Print "In this";TIME#;" minute test :"
Print
Print "Your typing speed was ";1/TIME#*WORDS#;" wpm"
Print
Print "Your accuracy was ";(WORDS#-BOOBOOS#)/WORDS#*100.0;" %"
Print
Print "Press any key to continue..."
Wait Key
Clear Key
Loop
Edit